from datetime import datetime
def a1():
    print('这是模块a1')
    print(__name__)

#一个显示程序开始和结束时间的装饰器
def calculate_times(hour1,hour2,min1,min2,sec1,sec2):
    return (hour2-hour1)*3600+(min2-min1)*60+sec2-sec1
def date_calculater(func):
    def inner(*args):
        now1=datetime.now()
        print('{}程序运行的开始时间是:{}时{}分{}秒'.format(func.__name__,now1.hour,now1.minute,now1.second))
        ans=func(*args)
        now2 = datetime.now()
        print('{}程序运行的结束时间是:{}时{}分{}秒'.format(func.__name__,now2.hour, now2.minute, now2.second))
        print('{}程序运行的总时长为:{}秒'.format(func.__name__,calculate_times(now1.hour,now2.hour,now1.minute,now2.minute,now1.second,now2.second)))
        return ans
    return inner

if __name__=='__main__':
    a1()
'''
这是模块a1
__main__
'''